﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HammerMUD.Traits;
using HammerMUD.Rooms;
using HammerMUD.Characters;
using System.Xml.Serialization;

namespace HammerMUD.Items
{
    public class Item
    {
        private String name;
        private List<TraitBonus> bonuses;
        private Int64 room;
        private String characterName;
        private List<Item> items;
        private Int64 itemNumber;

        public Int64 ItemNumber
        {
            get { return itemNumber; }
            set { itemNumber = value; }
        }

        public List<Item> Items
        {
            get { return items; }
            set { items = value; }
        }

        public List<TraitBonus> Bonuses
        {
            get { return bonuses; }
            set { bonuses = value; }
        }

        [XmlIgnore]
        public Character Character
        {
            get { return CharacterUtilities.FindCharacter(characterName); }
            set { characterName = value.Name; }
        }

        [XmlIgnore]
        public Room Room
        {
            get { return RoomUtilities.FindRoom(room); }
            set { room = value.RoomNumber; }
        }

        public String Name
        {
            get { return name; }
            set { name = value; }
        }
    }
}
